#ifndef XBOXCONTROLLER_HEADER
#define XBOXCONTROLLER_HEADER

#include <Windows.h>
#include <XInput.h>
#include <vector.h>

#define LEFT			XINPUT_GAMEPAD_DPAD_LEFT
#define RIGHT			XINPUT_GAMEPAD_DPAD_RIGHT
#define UP				XINPUT_GAMEPAD_DPAD_UP
#define DOWN			XINPUT_GAMEPAD_DPAD_DOWN
#define BUTTON_A		XINPUT_GAMEPAD_A
#define BUTTON_B		XINPUT_GAMEPAD_B
#define BUTTON_X		XINPUT_GAMEPAD_X
#define BUTTON_Y		XINPUT_GAMEPAD_Y
#define START			XINPUT_GAMEPAD_START
#define BACK			XINPUT_GAMEPAD_BACK
#define LEFT_SHOULDER	XINPUT_GAMEPAD_LEFT_SHOULDER
#define RIGHT_SHOULDER	XINPUT_GAMEPAD_RIGHT_SHOULDER
#define LEFT_STICK		XINPUT_GAMEPAD_LEFT_THUMB
#define RIGHT_STICK		XINPUT_GAMEPAD_RIGHT_THUMB

class XBOXController
{
private:
	int id;
	XINPUT_STATE state;
	XINPUT_VIBRATION vibration;
public:
	XBOXController(int);

	bool UpdateState();

	WORD GetButtons();
	unsigned char GetTrigger(int);
	Vector2i GetStick(int);

	void SetVibration(unsigned short, unsigned short);
};

#endif